home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Amiga-E
/
E_v3.2a
/
Src
/
Various
/
2ndMousePort.e
next >
Wrap
Text File
|
1992-09-02
|
703b
|
29 lines
-> switches mouseports
OPT OSVERSION=37
MODULE 'devices/input', 'exec/io'
PROC main()
DEF request=NIL:PTR TO iostd,port=NIL
IF port:=CreateMsgPort()
IF request:=CreateIORequest(port,SIZEOF iostd)
IF OpenDevice('input.device',0,request,0)=0
request.command:=IND_SETMPORT
request.data:=[1]:CHAR -> 0 for original port, 1 for joyport
request.length:=1
DoIO(request)
CloseDevice(request)
ELSE
PutStr('Could not open input device\n')
ENDIF
DeleteIORequest(request)
ELSE
PutStr('Could not create iorequest\n')
ENDIF
DeleteMsgPort(port)
ELSE
PutStr('Could not open port\n')
ENDIF
ENDPROC